<?php
$html->addCrumb('Manager','/manager/');
$html->addCrumb('Unternehmen verwalten','/manager/companies/');

echo  $this->element('tasks',array('target'=>'/manager/companies'));
?>

<div class="title">Unternehmen verwalten</div>
<?php echo $this->element('flashMessage') ;

echo $this->Form->create();
?>

<table>
	<tr>
		<td class="noprint" style="border:none"><input type="text" name="find_company_name" value="<?php echo $this->params['form']['find_company_name']?>"></td>
		<td class="noprint" style="border:none"><input type="text" name="find_city" value="<?php echo $this->params['form']['find_city']?>"></td>
		<td class="noprint" style="border:none"  colspan="3"><input type="submit" value="Filtern"><a href="<?php echo $this->here ?>"><button>Reset Filter</button></a></td>
	</tr>
	<tr>
		<th>Name</th>
		<th>Stadt</th>
		<th>Notiz</th>
		
		<th class="noprint">Aktion</th>
	</tr>

	<?php
	$out = '';
	foreach($this->data as $key => $value){
		$out .= '
		<tr>
			<td>'.$value['Company']['company_name'].'</td>
			<td>'.$value['Company']['city'].'</td>
			<td>'.$value['Company']['free_text'].'</td>
			<td class="noprint">
				<a href="'.URL_PREFIX.'/manager/companies/delete/'.$value['Company']['id'].'">
				<button>Löschen</button></a>
				<a href="'.URL_PREFIX.'/manager/companies/update/'.$value['Company']['id'].'">
				<button>Ändern</button></a>
			</td>
		<tr>
		';
	}
	echo $out;

	?>
</table>
<?php 
echo $this->Form->end();
?>